﻿@using Orchard.ContentManagement
@using Orchard.MediaLibrary.Fields
@using Orchard.Utility.Extensions;
@using Contrib.BSCarouselSlide.Models;
@using Orchard.DisplayManagement.Shapes;
@{
    var field       = (MediaLibraryPickerField)Model.ContentField;
    string name     = field.DisplayName;
    var contents    = field.MediaParts;
    var carousel    = ((IContent)Model.ContentPart).As<BSCarouselSlidePart>();
    bool HasText    = carousel.HasText;
    bool HasImage   = carousel.HasImage;
    var imageClass  = carousel.ImageClass;
    string span     = ( HasText ) ? "col-sm-7" : "span12"; 

    
}
@if (HasImage )
{
    foreach(var content in contents) {
        <div class="@span @imageClass media-library-picker-field media-library-picker-field-@name.HtmlClassify() bscentertxt" >
            <img src="@Url.Content(content.MediaUrl)" alt="@content.AlternateText" />
        </div>
    }
}

